import { defineComponent } from 'vue';
import { PropType } from "vue";
import Styles from "./index.module.scss"

export default defineComponent({
    props: {
        icon: {
            required: true,
            type: String as PropType<String>
        },
        color: {
            required: false,
            type: String as PropType<String>
        },
        size: {
            default: "1em",
            required: false,
            type: String as PropType<String>
        }
    },
    setup(props) {
        import("@/assets/iconfont/iconfont.js" as string);
        return () => (<>
            <svg class={Styles.al_icon}
                style={{ color: props.color as string, fontSize: props.size as string }}
                aria-hidden="true">
                <use xlinkHref={'#' + props.icon} />
            </svg>
        </>);
    }
})